/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mobiqueen.ui;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.PopupWindow;

/**
 *
 * @author HPUser
 */
public class MainActivity extends Activity {

Button myButton;
PopupWindow popupWindow;


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);

        myButton = (Button) findViewById(R.id.ClkBtn);
        myButton.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                LayoutInflater inflater = (LayoutInflater)MainActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);


                popupWindow = new PopupWindow(inflater.inflate(R.layout.popup1, null, false), 150, 150, true);

                // RelativeLayout01 is Main Activity Root Layout
                popupWindow.showAtLocation(findViewById(R.id.RelativeLayout01), Gravity.CENTER, 0, 0);


            }
        });


    }
}
    


